]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: Only reset search entry if it has key focus
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 18 Aug 2019 10:49:42 +0000 (12:49 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 18 Sep 2019 15:56:26 +0000 (15:56 +0000)
If the search entry does not have any text typed in and a button press
happens outside of the search entry, we set key focus to NULL to make
the search entry appear unfocused.

This is quite intrusive and can easily cause unwanted focus changes, so
change the captured-event handler to only call `reset()` if the search
entry actually is focused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/683

js/ui/viewSelector.js

index df69adfccb4ae7c6293eca7f5f8a77a6d9b3251c..4e82c4968b693ba7d51370640b696c9a3ed2f4b0 100644 (file)
@@ -577,6 +577,7 @@ var ViewSelector = class {
         if (event.type() == Clutter.EventType.BUTTON_PRESS) {
             let source = event.get_source();
             if (source != this._text &&
+                this._text.has_key_focus() &&
                 this._text.text == '' &&
                 !this._text.has_preedit () &&
                 !Main.layoutManager.keyboardBox.contains(source)) {